home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
aminet
/
util
/
gnu
/
gnu_smalltalk1_2.lha
/
SystemDictionary.st
< prev
next >
Wrap
Text File
|
1992-02-15
|
3KB
|
112 lines
"======================================================================
|
| SystemDictionary Method Definitions
|
======================================================================"
"======================================================================
|
| Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
| Written by Steve Byrne.
|
| This file is part of GNU Smalltalk.
|
| GNU Smalltalk is free software; you can redistribute it and/or modify it
| under the terms of the GNU General Public License as published by the Free
| Software Foundation; either version 1, or (at your option) any later version.
|
| GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
| FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
| details.
|
| You should have received a copy of the GNU General Public License along with
| GNU Smalltalk; see the file COPYING. If not, write to the Free Software
| Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
======================================================================"
"
| Change Log
| ============================================================================
| Author Date Change
| sbb 20 Apr 91 Added some methods for testing and modifying
| implementation specific features.
|
| sbb 16 Mar 91 Class creation now separate statement.
|
| sbyrne 22 Apr 90 Fixed Dependencies to be an IdentityDictionary
| instead of a regular Dictionary. This has better
| semantics and is faster.
|
| sbyrne 4 Jul 89 added initBlocks methods.
|
| sbyrne 25 Apr 89 created.
|
"
Dictionary variableSubclass: #SystemDictionary
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: nil
!
SystemDictionary comment:
'I am a special form of dictionary. Typically I only have one instance,
called "Smalltalk", which is known to the Smalltalk interpreter. I define
several methods that are "system" related, such as #quitPrimitive.
My instance also helps keep track of dependencies between objects.' !
">>> See also builtins.st for some non-primitive but highly useful
SystemDictionary method definitions."
!SystemDictionary methodsFor: 'basic'!
initialize
InitBlocks _ OrderedCollection new.
self at: #Dependencies put: (IdentityDictionary new)
"### I don't think this is
the right way to do this"
!
addInit: aBlock
"Adds 'aBlock' to the array of blocks to be invoked after every start
of the system."
InitBlocks add: aBlock
!
doInits
"Called after the system has loaded the image, this will invoke any
init blocks that have been installed."
InitBlocks do: [ :aBlock | aBlock value ]
!
dependenciesAt: anObject
^(Smalltalk at: #Dependencies) at: anObject
!
hasFeatures: features
" Returns true if the feature or features in 'features' is one of the
implementation dependent features present"
features class == Symbol
ifTrue: [ ^Features includes: features ]
ifFalse:
[ features do: [ :feature | (Features includes: feature)
ifTrue: [ ^true ]].
^false ]
!
addFeature: aFeature
Features _ Features asSet.
Features add: aFeature
!
removeFeature: aFeature
Features _ Features asSet.
Features remove: aFeature
!!